<?php
	DEFINE('H1', 'Automobile Class-1');
	DEFINE('TITLE','Workin with Classes in PHP');
	require('includes/header.php');
?>	
	<h2><?PHP echo H1 ?></h2>

<?php

class Automobile{
	public $color;
	public $make;
	public $speed = 55;

	public function accelerate(){
	$this->speed += 10;
	echo"Accelerating to $this->speed...\n<br/>";
	}
	public function brake(){
	$this->speed -= 10;
	echo "Slowing down to $this->speed...\n<br />";
	}
	public function turn() {
	$this->brake();
	echo "Turning...\n<br />";
	$this->accelerate();
	}
}
?>

<?php
	$car = new Automobile;
	
	$car->color = 'Red';
	$car->make = 'Ford Taurus';
	
	echo "Firing up my $car->color $car->make ...<br />";
	
	$car->accelerate();
	$car->brake();
	$car->turn();
	
?>

<?php
	require('includes/footer.php');
?>